var mongoose = require('mongoose');

var schemaOptions = {
  timestamps: true,
  toJSON: {
    virtuals: true
  }
};

var campanhaSchema = new mongoose.Schema({
  urlname: {type: String, unique: true},
  name: String,
  logo_pic: String,
  status: String, /* encerrada, completa , andamento*/
  criador: { type : mongoose.Schema.ObjectId, ref : 'User' },
  weneed: String,
  wehave: String,
  description: String,
  short_description: String,
  profile_pic: String,
  allowmenubar: Boolean,
  og_image: String,
  og_title: String,
  og_description: String,
  customdomain: String,
  paypal_link: String,
  paypal_email: String,
  pagseguro: String,
  vakinha: String,
  facebook_url: String,
  instagram_url: String,
  twitter_url: String,
  email_contato: String,
  telefone_contato: String,
  wpp_contato: String,
  wpp2_contato: String,
  telegram_contato: String,
  imgbg: String,
  galeria: [],
  bancos: {
    banco1: {
      info: String,
      banco: String,
      titular: String,
      cpf: String,
      ag: String,
      conta: String,
      op: String,
    },
    banco2: {
      info: String,
      banco: String,
      titular: String,
      cpf: String,
      ag: String,
      conta: String,
      op: String,
    },
    banco3: {
      info: String,
      banco: String,
      titular: String,
      cpf: String,
      ag: String,
      conta: String,
      op: String,
    },
    banco4: {
      info: String,
      banco: String,
      titular: String,
      cpf: String,
      ag: String,
      conta: String,
      op: String,
    }
  }
}, schemaOptions);


var Campanha = mongoose.model('Campanha', campanhaSchema);

module.exports = Campanha;
